//
//  WithdrawAccountVC.m
//  GasBusiness
//
//  Created by zfc on 2021/8/22.
//

#import "WithdrawAccountVC.h"
#import "WithdrawAccountCell.h"

@interface WithdrawAccountVC ()

@end

@implementation WithdrawAccountVC

- (void)viewDidLoad {
    [super viewDidLoad];

    self.navigationItem.title = @"提现账户";
    [self setUI];
    
}

//- (void)fetchData {
//    NSString *url = @"/tiny-shop/v1/bank-account/index";
//    NSMutableDictionary *params = [NSMutableDictionary dictionary];
//    params[@"page"] = @(self.page);
//    [[NetWorksTools shared] requestWithMethod:GET url:url params:params successBlock:^(NSDictionary * _Nonnull response) {
//        [self endRefresh];
//        self.dataList = response[@"data"];
//
//        [self.tableView reloadData];
//    } failureBlock:^(NSError * _Nonnull error) {
//
//    }];
//}

- (void) setUI {
    [self.tableView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.leading.trailing.equalTo(self.view);
    }];

    [self.tableView registerClass:[WithdrawAccountCell class] forCellReuseIdentifier:@"WithdrawAccountCell"];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.accountList.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    NSDictionary *dic = self.accountList[indexPath.row];
    WithdrawAccountCell *cell = [tableView dequeueReusableCellWithIdentifier:@"WithdrawAccountCell"];
    cell.dic = dic;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    NSDictionary *dic = self.accountList[indexPath.row];

    if (self.chooseAccountBlock) {
        self.chooseAccountBlock(dic);
    }
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return UITableViewAutomaticDimension;
}


@end
